package com.yhb.channel.impl.ANYPAY;

import com.fasterxml.jackson.annotation.JsonSetter;
import com.yhb.channel.model.BankCard;
import com.yhb.channel.model.IBankCard;
import com.yhb.channel.utils.ChannelJSONUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class AnyPayBindCardPayload {
    private String userId;
    private IBankCard card;
    private String clientIP;
    private String requestId;
    private String subAccountNo;
    private String serialNo;
    private String channelUserId;

    @JsonSetter("payCard")
    public void setCard(HashMap cardMap) {
        this.card = ChannelJSONUtil.parseJson(cardMap, BankCard.class);
    }
}
